This repository was archived by the owner on Mar 30, 2026. It is now read-only.
Switch NLSolve to BracketingNonlinearSolve for stability detection#180
Merged
ChrisRackauckas merged 1 commit intoSciML:masterfrom Mar 23, 2026
Conversation
Replace NLsolve with BracketingNonlinearSolve (Bisection) for finding stability region boundaries. Since stability functions are 1D with |r(0)|=1 (0-stable) and |r(±∞)|>1 (not ∞-stable), bracketing between a point near 0 and a far point reliably finds the boundary. For A-stable methods, falls back to a bracket spanning 0. Closes SciML#179 Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ChrisRackauckas
approved these changes
Mar 23, 2026
| # far from 0 (outside stability region). Solvers are 0-stable (|r(0)|=1) | ||
| # and not ∞-stable, so a sign change must exist between these points. | ||
| near_zero = sign(initial_guess) * one(T) / T(10) | ||
| far = initial_guess * T(10) |
Member
There was a problem hiding this comment.
is 10 big enough to actually find a root?
Member
There was a problem hiding this comment.
The only method that this doesn't work on is Chebyshev methods, which would fail for other reasons because of its adaptivity of building its tableau. So it's good enough, we can make this open ended another way in the future if someone actually cares, but as a dev tool, good enough.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NLsolvedependency withBracketingNonlinearSolvefor stability region boundary detectionBisection()solver withIntervalNonlinearProblem— since stability functions are 1D with|r(0)|=1(0-stable) and|r(±∞)|>1(not ∞-stable), bracketing reliably finds the boundaryCloses #179
Changes
NLsolve→BracketingNonlinearSolvein[deps]and[compat]stability_regionandimaginary_stability_intervalto useIntervalNonlinearProblem{false}withBisection()Test plan
stability_region_test.jltests pass (including@inferredtype stability checks, Float32 support)Pkg.test()passes🤖 Generated with Claude Code